import {BaseConfig, FieldConfig, OptionItem} from "@/fields/config";

export class RadioConfig extends BaseConfig {
  title = "单项选择";
  propsValue = {
    'radio': 'radio'
  }
}

const fieldType = "radio";

export const radioDefine = {
  name:"单项选择",
  icon:"el-icon-switch-button",
  type: fieldType,
  create: () => {
    const config = new RadioConfig();
    for (let i = 1; i < 4; i++) {
      config.optionList.push(new OptionItem("选项" + i))
    }
    return new FieldConfig(fieldType, config);
  },
  design: () => import(/* webpackChunkName: "form.comp.all" */ "@/views/fields/designer/radio/index"),
  config: () => import(/* webpackChunkName: "form.comp.all" */ "@/views/fields/common/PropsPanel")
}
